<html>
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<head>
  <link href="default.css" rel="stylesheet" type="text/css"/>
</head>


<body>
<div id="header">
  <div id="logo">
    <h1>Sitebricks</h1>

    <h2>a fast, light web framework from Google</h2>
  </div>
  <div id="menu">
    <ul>
      <li class="active"><a href="http://code.google.com/p/google-sitebricks">Google Sitebricks</a>
      </li>

      <li><a href="http://google-sitebricks.googlecode.com/svn/trunk">source</a></li>
      <li><a href="http://code.google.com/p/google-sitebricks/wiki/list">doc</a></li>
      <li><a href="http://code.google.com/p/google-guice">guice</a></li>
    </ul>
  </div>
</div>

<div id="page">
  <!-- start content -->
  <div id="content">
    <div class="post">
      <h1 class="title">examples</h1>

      @Repeat(items=data, var="event")
      <div class="result ${event}">${event}</div>

      The following demonstrates a routing mechanism using the Select annotation
      <br/><br/>

      <h2>GET</h2>
      <form method="get">
        <input id="shouldRenderDivForDefaultGetOnlySubmit" type="submit"/>
      </form>

      <form method="get">
        <input name="event" value="foo"/>
        <input id="shouldRenderDivForFooGetOnlySubmit" type="submit"/>
      </form>

      <form method="get">
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForBarGetOnlySubmit" type="submit"/>
      </form>


      <form method="get">
        <input name="event" value="foo"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForFooBarGetSubmit" type="submit"/>
      </form>

      <form method="get">
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownGetSubmit" type="submit"/>
      </form>

      <form method="get">
        <input name="event" value="foo"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownAndFooGetSubmit" type="submit"/>
      </form>
      
      <form method="get">
        <input name="event" value="304"/>
        <input id="shouldRenderDivForRedirectGetSubmit" type="submit"/>
      </form>


      <h2>POST</h2>
      <form method="post">
        <input id="shouldRenderDivForDefaultPostOnlySubmit" type="submit"/>
      </form>
      
      <form method="post">
        <input name="event" value="foo"/>
        <input id="shouldRenderDivForFooPostOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForBarPostOnlySubmit" type="submit"/>
      </form>


      <form method="post">
        <input name="event" value="foo"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForFooBarPostSubmit" type="submit"/>
      </form>

      <form method="post">
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownPostSubmit" type="submit"/>
      </form>

      <form method="post">
        <input name="event" value="foo"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownAndFooPostSubmit" type="submit"/>
      </form>

      <form method="post">
        <input name="event" value="304"/>
        <input id="shouldRenderDivForRedirectPostSubmit" type="submit"/>
      </form>


      <h2>PUT</h2>
      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input id="shouldRenderDivForDefaultPutOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="foo"/>
        <input id="shouldRenderDivForFooPutOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForBarPutOnlySubmit" type="submit"/>
      </form>


      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="foo"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForFooBarPutSubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownPutSubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="foo"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownAndFooPutSubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="put"/>
        <input name="event" value="304"/>
        <input id="shouldRenderDivForRedirectPutSubmit" type="submit"/>
      </form>
      
      
      <h2>DELETE</h2>
      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input id="shouldRenderDivForDefaultDeleteOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="foo"/>
        <input id="shouldRenderDivForFooDeleteOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForBarDeleteOnlySubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="foo"/>
        <input name="event" value="bar"/>
        <input id="shouldRenderDivForFooBarDeleteSubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownDeleteSubmit" type="submit"/>
      </form>

      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="foo"/>
        <input name="event" value="unknown"/>
        <input id="shouldRenderDivForUnknownAndFooDeleteSubmit" type="submit"/>
      </form>
      
      <form method="post">
        <input type="hidden" name="__sitebricks__action" value="delete"/>
        <input name="event" value="304"/>
        <input id="shouldRenderDivForRedirectDeleteSubmit" type="submit"/>
      </form>


      <br/>
      Hint: POST button removes hidden field via javascript and then submits normally via POST
      <br/>
      Bound:
      <p id="boundText">
      </p>
    </div>


    <div class="meta">
      <p class="byline">Google Sitebricks.</p>
    </div>
  </div>
</div>

</body>
</html>
